const express = require("express"),
    router = express.Router(),
    { body } = require("express-validator"),
    authController = require("../controller/authController");

router.post("/register", [body("username").notEmpty().withMessage("账号不能为空"), body("password").notEmpty().withMessage("密码不能为空")], authController.register); //注册
router.post("/login", [body("username").notEmpty().withMessage("账号不能为空"), body("password").notEmpty().withMessage("密码不能为空")], authController.login); //登录

module.exports = router;
